package headfirst.combined.djview;
  
public class MusicController implements ControllerInterface {
	BeatModelInterface model;
	DJView view;
	
	public MusicController(BeatModelInterface model) {
		this.model = model;
		view = new DJView(this, model);
        view.createView();
        view.createControls();
		view.disableStopMenuItem();
		view.enableStartMenuItem();
		model.initialize();
	}
  
	public void start() {
		model.on();
		view.disableStartMenuItem();
		view.enableStopMenuItem();
	}
  
	public void stop() {
		model.off();
		view.disableStopMenuItem();
		view.enableStartMenuItem();
	}

    //MusicDrive: 1- Pasar al instrumento siguiente
	public void increaseBPM() {
		//System.out.println("InstrumentoAnterior: "+model.getInstrumentoActual());
        model.sgteInstrumento();
        //System.out.println("InstrumentoActual: "+model.getInstrumentoActual());
	}

    //MusicDrive: 2- Pasar al instrumento anterior
	public void decreaseBPM() {
		//System.out.println("InstrumentoAnterior: "+model.getInstrumentoActual());
        model.anteInstrumento();
        //System.out.println("InstrumentoActual: "+model.getInstrumentoActual());
  	}

	//MusicDrive: 3- Setear el bpm del instrumento actual
 	public void setBPM(int bpm) {
        model.setBPM(bpm);
	}
}
